<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/conn_db.php");?>
<?include ($_SERVER ["DOCUMENT_ROOT"] . "/lib/module/Util.php");?>
<?php //DB Open

	$result = null;
	$db = new MyDB ( false );
	$db->err_report = true;

?>
<?php

	$util = new Util();

	$page = $_GET ["page"];

	if (!$page)	$page = 1;
	
	$orderby = $_GET ["orderby"];

	if (!$orderby)	$orderby = "article_title ASC";
	//else $orderby .= " ASC";
	
	$pern = 6;
	$perb = 10;

	//$condition = $_GET ["condition"];
	$words = $_GET ["words"];

	if($words!=""){
		$search .= " and article_exp7 LIKE '%".$words."%'";
	}

	$sid = $_GET['sid'];

	$addStr = "sid=".$sid."&orderby=".$orderby."&words=".$words;

	$sql = "SELECT * from tb_board_article WHERE category_sid=".$sid." and board_sid=4".$search." ORDER BY ".$orderby;
	$db->query ( $sql );
	$query = $db->result;
	$total = mysql_num_rows ($query);

	if ($total > 0) {

		$lastpage = ceil( $total / $pern );
		if ( $page > $lastpage ) $page = $lastpage;
		$first = ( $page - 1 ) * $pern;

		// 페이징 목록
		$lastbl = ceil ( $lastpage / $perb );
		$bl = ceil ( $page / $perb );
		$stpage = ($bl - 1) * $perb + 1;
		$edpage = ($bl - 1) * $perb + $perb;
		// 글번호
		$start_no = $total - (($page - 1) * $pern);

		$sql .= " limit $first, $pern ";


		$db->query ( $sql );
		$result = $db->result;
	}
	$i=0;
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<? include "inc/inc_header.php" ?><!-- header -->
<style>
#han:link {color: red;text-decoration: none;}
#han:visited {text-decoration: none;color: red;}
#han:hover {text-decoration: underline;color: #CCC876;font-weight: bold;}
#han:active {text-decoration: none;color: red;font-weight: bold;}
</style>
 <body style="background-color:transparent"  oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
<table width="954" border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td width="230" valign="top"><table width="220" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td height="12">&nbsp;</td>
	</tr>
	  <tr>
		<td><img src="img/surn/cont_img12.jpg" width="220" height="12"></td>
	  </tr>
	  <tr>
		<td align="center" background="img/surn/cont_img14.jpg"><table width="184" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td><table width="184" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
				<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=" class="su"><strong>전체 인물</strong></a></td>
			  </tr>
			</table></td>
		  </tr>
		  <tr>
			<td height="1" bgcolor="#EBEBEB"></td>
		  </tr>
		</table>
		<table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=종친회관련인" class="su"><strong>종친회관련인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		</table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=공무원" class="su"><strong>공무원</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=정치인" class="su"><strong>정치인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=경제/기업인" class="su"><strong>경제/기업인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=금융인" class="su"><strong>금융인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=군인" class="su"><strong>군인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=법조인" class="su"><strong>법조인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=언론인" class="su"><strong>언론인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=교육인" class="su"><strong>교육인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=의료인" class="su"><strong>의료인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=전문직업인" class="su"><strong>전문직업인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=종교인" class="su"><strong>종교인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=연구학술인" class="su"><strong>연구학술인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=문화예술인" class="su"><strong>문화예술인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=스포츠인" class="su"><strong>스포츠인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td height="1" bgcolor="#EBEBEB"></td>
			</tr>
		  </table>
		  <table width="184" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="184" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20" height="29"><img src="img/surn/cont_bl01.jpg" width="11" height="13"></td>
					<td class="text02"><a href="<?=$_SERVER ["PHP_SELF"]?>?sid=<?=$sid?>&words=대중문화연예인" class="su"><strong>대중문화 연예인</strong></a></td>
				  </tr>
			  </table></td>
			</tr>
		  </table></td>
	  </tr>
	  <tr>
		<td><img src="img/surn/cont_img13.jpg" width="220" height="12"></td>
	  </tr>
	</table></td>
	<td width="724" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
	 <tr>
	   <td align="right" class="text08" style="padding-bottom:10px;"><strong>[가나다順]</strong></td>
	 </tr>
	  <tr>
		<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td height="2" bgcolor="#212725"></td>
				  </tr>
				  <tr>
					<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#585858">
						<tr>
						  <td width="16%" height="30" align="center" class="dbtit01">사진</td>
						  <td width="1"><img src="img/board/list_line.gif" width="1" height="8" /></td>
						  <td width="64%" align="center" class="dbtit01"><strong>성명</strong></td>
						  <td width="1"><img src="img/board/list_line.gif" width="1" height="8" /></td>
						  <td width="20%" align="center" class="dbtit01"><strong>파(派) / 세(世)</strong></td>
						</tr>
					</table></td>
				  </tr>
				  <tr>
					<td height="1" bgcolor="#585858"></td>
				  </tr>
			  </table></td>
			</tr>
			<tr>
			  <td>
			  <?php if($total>0):?>
				<?php while($row = mysql_fetch_object($result)):?>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">
						<tr> <td width="16%" align="center" class="dbtop9" style="padding:8px 0 8px 0;"><img src="uploads/4/<?php echo $row->article_title_img;?>" width="52" height="68"></td>
						  <td width="64%" align="left" class="dbtop9" style="padding-left:12px">
						  <a href="pup03.php" class="su" onclick="top.popup(this.href+'?sid=<?php echo $row->article_sid;?>', '460','336');return false" ><strong>
						  <?php echo $row->article_title;?></strong>(<?php echo $row->article_exp1;?>, <?php echo $row->article_exp2;?>)</a></td>
						  <td width="20%" align="center" class="dbtop9"><?php echo $row->article_exp9;?></td>
						</tr>
					</table></td>
				  </tr>
				  <tr>
					<td height="1" bgcolor="#BCBCBC"></td>
				  </tr>
				</table>
				<?php endwhile;?>
			  <?php endif;?>
			  </td>
			</tr>
		</table></td>
	  </tr>
	  <tr>
		<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
			  <td height="30" align="right" valign="bottom"><a href="#"></a></td>
			</tr>
			<tr>
			  <td align="center">
			<?php if ($total > 0) : ?>
				<table cellspacing="0" cellpadding="0">
				  <tr>
					<td width="20">
					  <?php if($stpage-10>0): ?>
					    <a href="<?=$_SERVER["PHP_SELF"]?>?page=<?=$stpage-10?>&amp;<?=$addStr?>">
					      <img height="7" src="img/board/btn_prev_01.gif" width="9" align="absmiddle" border="0" />
						</a>
					  <?php endif;?>
					</td>
					<td width="20">
					  <a href="<?=$_SERVER["PHP_SELF"]?>?page=1&amp;<?=$addStr?>">
					    <img height="7" src="img/board/btn_prev_02.gif" width="5" align="absmiddle" border="0" />
					  </a>
					</td>
					<td align="middle" class="dbpaging">
					<?
						for($i=$stpage; ($i<=$edpage && $i<=$lastpage); $i++) {
							if($i<0)
							{
								continue;
							}
							if($i==$page)
							{
								echo "<a href='".$_SERVER['PHP_SELF']."?page=$i&amp;$addStr'><span class='dbbold'>".$i."</span></a>";
							}else{
								echo "<a href='".$_SERVER['PHP_SELF']."?page=$i&amp;$addStr' class='dblink'>".$i."</a>";
							}
						}
					?>
					</td>
					<td width="20" align="right">
					  <a href="<?=$_SERVER["PHP_SELF"]?>?page=<?=$lastpage?>&amp;<?=$addStr?>">
						<img src="img/board/btn_next_02.gif" width="5" height="7" border="0" align="absmiddle" />
					  </a>
					</td>
					<td width="20" align="right">
					  <?php if ($edpage < $lastpage):?>
					    <a href="<?=$_SERVER["PHP_SELF"]?>?page=<?=$stpage+10?>&amp;<?=$addStr?>">
						  <img height="7" src="img/board/btn_next_01.gif" width="9" align="absmiddle" border="0" />
					    </a>
					  <?php endif;?>
				   <?php endif;?>
				</td>
			</tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table>
 <? include "inc/inc_footer.php" ?><!-- footer -->